import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import loadingDirective from '@/components/base/loading/directive'
import noResultDirective from '@/components/base/no-result/directive'

import { Cell, List, PullRefresh, Swipe, SwipeItem } from 'vant'

import 'vant/lib/index.css'
import '@/assets/scss/index.scss'
import lazyPlugin from 'vue3-lazy'

const app = createApp(App)
app.use(Swipe)
app.use(SwipeItem)
app.use(List)
app.use(PullRefresh)
app.use(Cell)

app.use(store).use(router)
  // 全局注册v-lazy指令
  .use(lazyPlugin, {
    loading: require('@/assets/images/default.png')
  })
  // 全局注册v-loading指令
  .directive('loading', loadingDirective)
  .directive('no-result', noResultDirective)
  .mount('#app')
